<%Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<META NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta charset="UTF-8">
<TITLE>Selab - Net.Office</TITLE>
<!--#include file="..\CheckSession.inc"-->
<!--#include file=..\getFormName.inc-->
<%
bNgay=request("bNgay")
%>
<!--#include file="..\jvfunction.inc"-->
</HEAD>
<LINK href="../styles/styles.css" type=text/css rel=STYLESHEET>
<BODY Style="FONT-FAMILY: arial" topmargin=3 leftmargin=3 >
<form method=post name=frm action="frmInlich.asp">
<Input TYPE="hidden" name="bNgay" value="<%=bNgay%>">
<%	bThu=Request("bThu")
if  bThu=1 then%>
<Center><strong><font size=3>Lịch làm việc (Chủ nhật ngày <%=bNgay%>)</font></strong></center>
<%else%>
<Center><strong><font size=3>Lịch làm việc (Thứ <%=bThu%> ngày <%=bNgay%>)</font></strong></center>
<%end if%>
<%if Session("bLich")="TCUC" then%>
<TABLE border=0  cellPadding=1 cellSpacing=1 style="BORDER-BOTTOM-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid" width=100%>
	<TR bgColor=#bdd5d0 align=center>		
		<TD width=5%><b>TGBD</b></TD>
		<TD width=5%><b>TGKT</b></TD>
		<TD width=23%><b>Nội dung</b></TD>
		<TD Width=22%><b>Thành phần</b></TD>
		<TD Width=15%><b>Ðịa điểm</b></TD>
		<TD Width=15%><b>Đơn vị chủ trì</b></TD>
		<TD Width=15%><b>Ghi chú</b></TD>
	</TR>
	<%
	sSQL="select * from lichcongtac where ngaythang='"& SaveDate(bNgay)  &"' and madonvi='000000' order by thoigian,thoigiankt,noidung"
	Set Rec=Server.CreateObject("ADODB.Recordset")
	Rec.CursorType=3
	Rec.CacheSize=5
	Rec.Open sSQL,Conn
	do while not Rec.Eof
	%>
	<TR>
		<TD width=5% bgColor=#f8f9d9 ><font face=Arial><%=Rec("thoigian")%></font></TD>
		<TD Width=5% bgColor=#f8f9d9 ><font face=Arial><%=Rec("thoigiankt")%></font></TD>
		<TD width=23% bgColor=#f8f9d9 ><font face=Arial><%=Rec("noidung")%></font></TD>
		<TD Width=22% bgColor=#f8f9d9 ><font face=Arial><%=Rec("thanhphan")%></font></TD>
		<TD Width=15% bgColor=#f8f9d9 ><font face=Arial><%=Rec("diadiem")%></font></TD>
		<TD Width=15% bgColor=#f8f9d9 ><font face=Arial><%=Rec("dvtt")%></font></TD>
		<TD Width=15% bgColor=#f8f9d9 ><font face=Arial><%=Rec("ghichu")%></font></TD>
		</font>
	</TR>
	<%
	Rec.MoveNext
	loop
	Rec.close
	Set Rec=nothing
	%>
</TABLE>
<%else%>
<TABLE border=0  cellPadding=1 cellSpacing=1 style="BORDER-BOTTOM-STYLE: solid; BORDER-LEFT-STYLE: solid; BORDER-RIGHT-STYLE: solid; BORDER-TOP-STYLE: solid" width=100%>
	<TR bgColor=#bdd5d0 align=center>		
		<TD width=5%><b>TGBD</b></TD>
		<TD width=5%><b>TGKT</b></TD>
		<TD width=25%><b>Nội dung</b></TD>
		<TD Width=25%><b>Thành phần</b></TD>
		<TD Width=20%><b>Ðịa điểm</b></TD>
		<TD Width=20%><b>Ghi chú</b></TD>
	</TR>
	<%
	sSQL="select * from lichcongtac where ngaythang='"& SaveDate(bNgay)  &"' and madonvi='"& Session("bMaDonVi") &"' order by thoigian,thoigiankt,noidung"
	Set Rec=Server.CreateObject("ADODB.Recordset")
	Rec.CursorType=3
	Rec.CacheSize=5
	Rec.Open sSQL,Conn
	do while not Rec.Eof
	%>
	<TR>
		<TD width=5% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("thoigian")%></font></TD>
		<TD Width=5% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("thoigiankt")%></font></TD>
		<TD width=25% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("noidung")%></font></TD>
		<TD Width=25% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("thanhphan")%></font></TD>
		<TD Width=20% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("diadiem")%></font></TD>
		<TD Width=20% bgColor=#f8f9d9 valign="top"><font face=Arial><%=Rec("ghichu")%></font></TD>
	</TR>
	<%
	Rec.MoveNext
	loop
	Rec.close
	Set Rec=nothing
	%>
</TABLE>
<%end if%>
<p align=center><input type=submit value="In lịch trong tuần">
<%if Session("bLich")="TCUC" then
sSQL="Select * from lichthongbao where Ngaythang ='"& SaveDate(bNgay)  &"' and Madonvi = '000000'"
Set RecLTB=server.CreateObject("ADODB.Recordset")
RecLTB.CursorType=3
RecLTB.CacheSize=5
RecLTB.open SSQL,Conn
	if RecLTB.RecordCount then%>
		<TABLE border=0 cellPadding=1 cellSpacing=1 style="font-family:arial;font-size:14px" width=100%>
			<tr><TD Width=100%>&nbsp;</td></tr>
			<TR bgColor=#bdd5d0 align=center>
			<TD Width=100%><b>THÔNG BÁO</b></TD>
			</TR>
			<TR align=center>
			<TD Width=100% align=left style="font-family:arial;font-size:13px" bgcolor=<%=color%>><%=trim(RecLTB("thongbao"))%>
			</TD>
			</TR>
		</Table>		
	<%
	end if
RecLTB.close
Set RecLTB=Nothing
else
sSQL="Select * from lichthongbao where Ngaythang ='"& SaveDate(bNgay)  &"' and Madonvi = '"& Session("bMaDonVi") &"'"
Set RecLTB=server.CreateObject("ADODB.Recordset")
RecLTB.CursorType=3
RecLTB.CacheSize=5
RecLTB.open SSQL,Conn
	if RecLTB.RecordCount then%>
		<TABLE border=0 cellPadding=1 cellSpacing=1 style="font-family:arial;font-size:14px" width=100%>
			<tr><TD Width=100%>&nbsp;</td></tr>
			<TR bgColor=#bdd5d0 align=center>
			<TD Width=100%><b>THÔNG BÁO</b></TD>
			</TR>
			<TR align=center>
			<TD Width=100% align=left style="font-family:arial;font-size:13px" bgcolor=<%=color%>><%=trim(RecLTB("thongbao"))%>
			</TD>
			</TR>
		</Table>		
	<%end if
RecLTB.close
Set RecLTB=Nothing
end if
%>
<%if Session("bLich")="TCUC" then
sSQL="Select * from lichtrucn where Ngaythang ='"& SaveDate(bNgay)  &"' and Madonvi = '000000'"
Set RecLichTruc=server.CreateObject("ADODB.Recordset")
RecLichtruc.CursorType=3
RecLichtruc.CacheSize=5
RecLichtruc.open SSQL,Conn
if RecLichtruc.RecordCount then
if bThu=1 then%>
<Center><strong><font size=3>Lịch trực (Chủ Nhật Ngày <%=bNgay%>)</font></strong></center>
<%else%>
<Center><strong><font size=3>Lịch trực (Thứ <%=bThu%> Ngày <%=bNgay%>)</font></strong></center>
<%end if%>
<TABLE border=0 cellPadding=1 cellSpacing=1 style="font-family:arial;font-size:14px" width=100%>
<TR bgColor=#bdd5d0 align=center>
<TD Width=100%>Danh sách cán bộ trực</TD>
</TR>
<TR align=center>
<TD Width=100% align=left bgcolor=<%=color%>><pre style="font-family:arial"><%=trim(RecLichtruc("cbtruc"))%></pre>
</TD>
</TR>
</Table>
<%
end if
RecLichtruc.close
Set RecLichtruc=nothing
else
sSQL="Select * from lichtrucn where Ngaythang ='"& SaveDate(bNgay)  &"' and Madonvi = '"& Session("bMaDonVi") &"'"
Set RecLichTruc=server.CreateObject("ADODB.Recordset")
RecLichtruc.CursorType=3
RecLichtruc.CacheSize=5
RecLichtruc.open SSQL,Conn
if RecLichtruc.RecordCount then
if bThu=1 then%>
	<Center><strong><font size=3>Lịch trực (Chủ Nhật Ngày <%=bNgay%>)</font></strong></center>
<%else%>
	<Center><strong><font size=3>Lịch trực (Thứ <%=bThu%> Ngày <%=bNgay%>)</font></strong></center>
<%end if%>
<TABLE border=0 cellPadding=1 cellSpacing=1 style="font-family:arial;font-size:14px" width=100%>
<TR bgColor=#bdd5d0 align=center>
<TD Width=100%>Danh sách cán bộ trực</TD>
</TR>
<TR align=center>
<TD Width=100% align=left bgcolor=<%=color%>><pre style="font-family:arial"><%=trim(RecLichtruc("cbtruc"))%></pre>
</TD>
</TR>
</Table>
<%
end if
RecLichtruc.close
Set RecLichtruc=nothing
end if%>
</Form>
</body>
</html>
<script language=vbscript runat=server>
Function FormatDate(vDate)
	If Not IsNull(vDate) Then
	   vM = Right("0" & Month(vDate), 2)
	   vD = Right("0" & Day(vDate), 2)
	   vY = Right("19" & Year(vDate), 4)
	   FormatDate = vD & "/" & vM & "/" & vY
	End If
End Function
Function SaveDate(vDate)
	dim bvitri1
	dim bvitri2
	vDate=trim(cstr(vDate))
	bvitri1=instr(1,vDate,"/")
	bMonth=left(vDate,bvitri1-1)
	bvitri2=instr(bvitri1+1,vDate,"/")
	Dim Temp
	Temp=right(vDate,len(vDate)-bvitri1)
	bDay=left(Temp,bvitri2-bvitri1-1)
	bYear=right(vDate,len(vDate)-bvitri2)
    SaveDate=bDay+"/"+bMonth+"/"+bYear
End Function
</script>
</BODY>
</HTML>